<template>
  <div class="login-box">
    <h1 class="tc primary-color">Which one is true or false?</h1>
    <el-form :model="registerForm" label-width="0" label-position="left" class="login-form tc">
      <el-form-item>
        <el-input v-model="registerForm.username" placeholder="手机号"></el-input>
      </el-form-item>
      <el-form-item>
        <el-input v-model="registerForm.code" placeholder="验证码"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">注册</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
  export default {
    name: "register",
    data() {
      return {
        registerForm: {
          username: null,
          code: null
        }
      }
    },
    methods: {
      onSubmit() {
        this.$store.dispatch('register',this.registerForm);
      }
    }
  }
</script>

<style scoped>
  .login-box > h1 {
    margin: 120px 0 63px;
  }

  .login-form {
    width: 500px;
    margin: 0 auto 0;
  }
</style>
